﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/web.master" CodeBehind="audit_trail.aspx.cs" Inherits="Shuba.Web.audit.audit_trail" %>

<%@ Register Assembly="Shuba.Framework" Namespace="Shuba.Framework" TagPrefix="cc" %>
<asp:Content ID="Header1" ContentPlaceHolderID="HeaderPlaceHolder" runat="server">

    <script type="text/javascript">
		 function CheckAll()
        {
            var checkVal;
            if(document.all("ButSelect").value == "Check All")
            {
                checkVal = true;
                document.all("ButSelect").value = "Un-Check All";
            }else
            {
                checkVal = false;
                document.all("ButSelect").value = "Check All";
            }
            
            for (var n = 0; n < document.forms[0].length; n++) 
            {
                elm = document.forms[0].elements[n];
                if (elm.type == 'checkbox') 
                {
                    elm.checked = checkVal;
                }
            }
        }
        
        function konfirmasi()
        {
            var konfirmasi = confirm("Are you sure, you want to delete this record ?");
                if (konfirmasi == true)
                {
                    alert("To delete this record you have to make approval");
                    return true;
                }
                else
                {
                    alert("you have to cancel the delete process");
                    return false;
                }
        }
		
    </script>

</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="text" border="0" width="100%" cellspacing="0" cellpadding="2">
        <tr>
            <td class="text bg_content" bgcolor="#FFFFFF" align="center">
                <p>
                    &nbsp;</p>
                <table class="black" border="0" width="95%" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="title_back" align="left">
                            <table class="text" border="0" width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td class="title_back2" width="2%">&nbsp;</td>
                                    <td class="title_back2 title_white" width="38%">
                                        <asp:Label ID="LabelTitle" runat="server" Text="Label"></asp:Label>
                                    </td>
                                    <td>
                                        <span class="title_right"></span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td class="title_back" align="right"><br>&nbsp;</td>
                    </tr>
                   <tr>
					<td class="border_left bg_subtitle_white"><img src="../images/trans.gif" width="5" height="5" border="0" /></td>
					<td class="border_right bg_subtitle" align="right" valign="middle">
                        Period&nbsp;<asp:DropDownList ID="ddlTable" runat="server" CssClass="text"></asp:DropDownList>
                        &nbsp;<cc:DatePicker ID="txtStartDate" imgDirectory="../images/" ControlCssClass="text" CssClass="text" runat="server"></cc:DatePicker>&nbsp;to&nbsp;<cc:DatePicker
                            ID="txtToDate" imgDirectory="../images/" ControlCssClass="text" CssClass="text" runat="server"></cc:DatePicker>
                        <asp:Button ID="btnSearch" CssClass="buttonsmall" runat="server" Text="Search" 
                            onclick="btnSearch_Click" />&nbsp;
                        <asp:Button ID="btnExcel" CssClass="button" runat="server" 
                            Text="Export to Excel" onclick="btnExcel_Click" />
                            &nbsp;
                    </td>
				</tr>
                    <tr>
                        <td colspan="2">
                            <table class="border" width="100%">
                                <tr>
                                    <td class="text">
                                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                            <ContentTemplate>
                                                <cc:SHUBAGrid ID="gvList" runat="server" AutoGenerateColumns="False" Width="100%"
                                                    AllowPaging="True" PageSize="20" OnPageIndexChanging="gvList_PageIndexChanging"
                                                    OnRowDataBound="gvList_RowDataBound" AllowSorting="True"
                                                    OnSorting="gvList_Sorting">
                                                    <Columns>
                                                        <asp:BoundField DataField="ACT_TYPE" HeaderText="ACTION" SortExpression="ACT_TYPE" ItemStyle-CssClass="text" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="120px"></asp:BoundField>
                                                        <asp:BoundField DataField="TABLE_NAME" HeaderText="TABLE" SortExpression="TABLE_NAME" ItemStyle-CssClass="text" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="PRIMARY_KEY" HeaderText="KEY" SortExpression="PRIMARY_KEY" ItemStyle-CssClass="text" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="FIELD_NAME" HeaderText="FIELD NAME" SortExpression="FIELD_NAME" ItemStyle-CssClass="text" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="OLD_VALUE" HeaderText="OLD VALUE" SortExpression="OLD_VALUE" ItemStyle-CssClass="text" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="NEW_VALUE" HeaderText="NEW VALUE" SortExpression="NEW_VALUE" ItemStyle-CssClass="text" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
                                                        <asp:BoundField DataField="UPDATE_BY" HeaderText="USER" SortExpression="UPDATE_BY" ItemStyle-CssClass="text" ItemStyle-HorizontalAlign="Center"></asp:BoundField>
                                                        <asp:BoundField DataField="UPDATE_DATE" HeaderText="DATE" SortExpression="UPDATE_DATE" ItemStyle-CssClass="text" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:dd MMM yyyy hh:mm:ss tt}"></asp:BoundField>
                                                    </Columns>
                                                    <PagerSettings Mode="Numeric" Visible="true" />
                                                    <EmptyDataTemplate>
                                                        <table class="text" width="100%" cellpadding="0" cellspacing="0">
                                                            <tr>
                                                                <td class="bg_grid2" align="center">
                                                                    NO RECORD FOUND
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </EmptyDataTemplate>
                                                </cc:SHUBAGrid>
                                            </ContentTemplate>
                                            <Triggers>
                                                <asp:AsyncPostBackTrigger ControlID="gvList" EventName="PageIndexChanging" />
                                                <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
                                                <asp:AsyncPostBackTrigger ControlID="ddlPage" EventName="SelectedIndexChanged"/>
                                            </Triggers>
                                        </asp:UpdatePanel>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                                            <ContentTemplate>
                                                <div id="footLink" class="bg_footer text" runat="server">
                                                    <table width="100%">
                                                        <tr>
                                                            <td class="text">
                                                                <asp:ImageButton ID="firstLink" runat="server" CssClass="icon_first" OnClick="linkDataPage_Click"
                                                                    ImageUrl="~/images/trans.gif" />
                                                                <asp:ImageButton ID="prevLink" runat="server" CssClass="icon_previous" OnClick="linkDataPage_Click"
                                                                    ImageUrl="~/images/trans.gif" />
                                                                <asp:DropDownList ID="ddlPage" runat="server" CssClass="text" OnSelectedIndexChanged="ddlPipelinePage_IndexChange"
                                                                    AutoPostBack="true">
                                                                </asp:DropDownList>
                                                                <asp:ImageButton ID="nextLink" runat="server" CssClass="icon_next" OnClick="linkDataPage_Click"
                                                                    ImageUrl="~/images/trans.gif" />
                                                                <asp:ImageButton ID="lastLink" runat="server" CssClass="icon_last" OnClick="linkDataPage_Click"
                                                                    ImageUrl="~/images/trans.gif" />
                                                            </td>
                                                            <td style="text-align: right">
                                                                <asp:Label ID="lblPage" runat="server" Text="Page" CssClass="text"></asp:Label>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </ContentTemplate>
                                            <Triggers>
                                                <asp:AsyncPostBackTrigger ControlID="gvList" EventName="PageIndexChanging" />
                                                <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
                                                <asp:AsyncPostBackTrigger ControlID="ddlPage" EventName="SelectedIndexChanged" />
                                            </Triggers>
                                        </asp:UpdatePanel>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <br />
                <!-- Error Message -->
                <table runat="server" visible="false" id="ErrBox" border="0" width="100%" cellspacing="0"
                    cellpadding="2">
                    <tr>
                        <td class="bg_grid2" align="center">
                            <asp:Label ID="ErrMsg" runat="server" Text="" Font-Bold="true" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                </table>
                <!-- End Of Error Message -->
            </td>
        </tr>
    </table>
</asp:Content>
